package hidra.core.util;

import hidra.io.ObjectivesWriter;



public class SetGenerator {

	
	public void run(String problemName, int numObj, String pathname){		
		double[][] points = new double[numObj][numObj];		
		double extremeValue = 1.0;
			
		if(problemName.equals("DTLZ1")){									
			extremeValue = 0.5;
		
		}else{
			extremeValue = 1.0;
		
		}
		
		for(int i=0; i < numObj; i++){			
			double[] temp = new double[numObj];			
			for(int j=0; j < numObj ;j++){				
				if(j==i){
					temp[i] = extremeValue;
				}
			}
			points[i] = temp;			
		}
				
			
		ObjectivesWriter ow = new ObjectivesWriter();
		ow.printObjectivesToFile(points,pathname);
	}
	
	
	public static void main(String[] args) {
		
		SetGenerator s = new SetGenerator();
		String[] list = {"DTLZ1","DTLZ2","DTLZ3","DTLZ4","DTLZ6"};
		
		//String[]  list = {"DTLZ2"};
		
		
		int[] obj = {5,10,15,20,30,50};
			
		//int[] obj = {7,8};
		
		for(int i=0; i < list.length ; i++){			
			for(int j=0; j < obj.length; j++){				
				String pathname = "paretos/dtlz-" + obj[j] + "d/" + list[i] + "." + obj[j] + "D.pf";				
			    s.run(list[i],obj[j],pathname);
			}
			System.out.println("Finisned = " + i);
		}
		
		
	}
	
}
